<template>
	<view>
		<view class="header">
			<u-navbar
				:background="{ backgroundColor: '#3478F2' }"
				back-icon-color="#fff"
				back-icon-name="arrow-left"
				back-icon-size="40"
				title="协议列表"
				title-color="#fff"
				title-size="40"
				title-bold
			></u-navbar>
		</view>
		<scroll-view scroll-top="0" scroll-y="true" :style="`height:${scrollHeight}px`">
			<view class="page">
				<view class="item" @click="handleItemCall('register')">
					<image src="/static/icon/yonghu.png" mode="scaleToFill" class="icon" />
					<text>《用户注册服务协议》</text>
				</view>
				<view class="item" @click="handleItemCall('privacy')">
					<image src="/static/icon/yinsi.png" mode="scaleToFill" class="icon" />
					<text>《隐私协议》</text>
				</view>
				<view class="item" @click="handleItemCall('book')">
					<image src="/static/icon/zhiqingshu.png" mode="scaleToFill" class="icon" />
					<text>《贷款知情书》</text>
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
import { mixin } from '@/utils/mixins'
export default {
	mixins: [mixin],
	components: {},
	data() {
		return {}
	},
	onReady() {},
	// 方法集合
	methods: {
		handleItemCall(param) {
			let map = {
				privacy: {
					title: '用户隐私协议',
					url: 'https://website.zd-dqd.com/dqdxy/#/pages/agreement/privacy1'
				},
				register: {
					title: '用户注册服务协议',
					url: 'https://website.zd-dqd.com/dqdxy/#/pages/agreement/index1'
				},
				book: {
					title: '贷款知情书',
					url: 'https://website.zd-dqd.com/dqdxy/#/pages/agreement/book1'
				}
			}
			uni.navigateTo({
				url: `/pages/webView/index?name=${map[param].title}&url=${map[param].url}`
			})
		}
	}
}
</script>

<style lang="scss" scoped>
.page {
	height: 100%;
	padding: 16rpx 32rpx;
	background-color: #fff;
}
.item {
	font-size: 32rpx;
	font-family: PingFang SC;
	font-weight: 400;
	color: #333333;
	height: 108rpx;
	padding-top: 40rpx;
	padding-bottom: 12rpx;
	display: flex;
	align-items: center;
	border-bottom: 2rpx solid #f3f3f3;
}
.icon {
	width: 40rpx;
	height: 40rpx;
}
</style>
